<template>
  <el-form :model="models" :rules="rules" ref="qmGenForm" label-width="100px" class="qm-gen-form">
    <el-row>
      <el-col :span="12">
        <el-form-item label="编码：" prop="model.code">
          <el-input v-model="models.model.code"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="名称：" prop="model.name">
          <el-input v-model="models.model.name"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="类型：" prop="model.type">
          <el-select v-model="models.model.type">
            <el-option
              v-for="item in controlData.databaseTypes"
              :key="item.value"
              :value="item.value"
              :label="item.key"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="是否默认：" prop="model.isDefault">
          <el-switch v-model="models.model.isDefault"></el-switch>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="会话工厂" prop="model.sessionFactory">
          <el-input v-model="models.model.sessionFactory"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="链接：" prop="model.url">
          <el-input v-model="models.model.url"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="用户名：" prop="model.userName">
          <el-input v-model="models.model.userName"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="密码：" prop="model.password">
          <el-input v-model="models.model.password"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
export default {
  name: "smartform-smartDatabase-create",
  props: {
    models: Object,
    controlData: Object,
    pageAction: String,
  },
  data() {
    return {
      rules: {
        "model.code": [
          {
            required: true,
            message: "这是必填字段",
            trigger: "blur",
          },
        ],
        "model.name": [
          {
            required: true,
            message: "这是必填字段",
            trigger: "blur",
          },
        ],
        "model.type": [
          {
            required: true,
            message: "这是必填字段",
            trigger: "blur",
          },
        ],
      },
    };
  },
  methods: {},
};
</script>

<style scoped>
</style>